]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Clear AllView reference to current popup when destroyed
authorRay Strode <rstrode@redhat.com>
Thu, 18 Jul 2019 14:06:38 +0000 (10:06 -0400)
committerRay Strode <halfline@gmail.com>
Tue, 23 Jul 2019 14:53:24 +0000 (14:53 +0000)
AllView contains a reference to the current popup that lingers after
the popup is destroyed.

This commit fixes that, by explicitly nullifying when appropriate.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628

js/ui/appDisplay.js

index 7c2eaf02727ce05943739cc5f13d861d43c159d1..8d63a4eec7db49cb1cc01cee8069552b72500719 100644 (file)
@@ -285,6 +285,7 @@ var AllView = class AllView extends BaseAppView {
         this._eventBlocker.add_action(this._clickAction);
 
         this._displayingPopup = false;
+        this._currentPopupDestroyId = 0;
 
         this._availWidth = 0;
         this._availHeight = 0;
@@ -574,7 +575,22 @@ var AllView = class AllView extends BaseAppView {
         this._stack.add_actor(popup.actor);
         popup.connect('open-state-changed', (popup, isOpen) => {
             this._eventBlocker.reactive = isOpen;
-            this._currentPopup = isOpen ? popup : null;
+
+            if (this._currentPopup) {
+                this._currentPopup.actor.disconnect(this._currentPopupDestroyId);
+                this._currentPopupDestroyId = 0;
+            }
+
+            this._currentPopup = null;
+
+            if (isOpen) {
+                this._currentPopup = popup;
+                this._currentPopupDestroyId = popup.actor.connect('destroy', () => {
+                    this._currentPopup = null;
+                    this._currentPopupDestroyId = 0;
+                    this._eventBlocker.reactive = false;
+                });
+            }
             this._updateIconOpacities(isOpen);
             if (!isOpen)
                 this._closeSpaceForPopup();